package xyz.robinbingo.dailybill.web.rsp;

/**
 * 返回码枚举
 *
 * @author Robin
 * @date 2018/8/1 15:02
 **/
public enum RspEnum {


    // 成功
    SUCCESS(1000, "成功"),

    REQ_FAIL(2000, "请求失败"),
    REQ_FAIL_PARAM(2001, "请求参数出错"),

    USER_FAIL(3000, "用户错误"),
    USER_FAIL_NULL(3001, "无此用户"),
    USER_FAIL_LOGIN(3002, "登录失败"),
    USER_FAIL_REGISTER(3003, "注册失败"),

    SQL_FAIL(4000, "数据操作失败"),
    SQL_FAIL_INSERT(4001, "新建记录失败"),
    SQL_FAIL_UPDATE(4002, "更新记录失败"),
    SQL_FAIL_DELETE(4003, "删除记录失败"),

    FAIL(9999, "失败");

    /******************************fields******************************/

    private final int code;
    private final String message;

    /******************************getters******************************/

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    /******************************methods******************************/

    RspEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }
}